package Control;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import Entity.MsgPackage;
import GUI.PerformanceStageGui;
import GUI.ScreenManager;

public class PerformanceStageControl {
	private PerformanceStageGui per_stage_gui;
	private MsgPackage performance;
	private String data;
	
	public  PerformanceStageControl(){
		per_stage_gui= new PerformanceStageGui(); 
		performance= new MsgPackage();
	}

	public PerformanceStageGui getPerformanceGui() {
		return per_stage_gui;
	}
	
	public void reqANDstageEntered(String ReqNum){
		data= ReqNum;
		
	}

	public void performance_Submit_pressed() {
		if((per_stage_gui.getCompletion().isSelected())==false){
			JOptionPane.showMessageDialog(null, "Not all the fileds all the fill", "ERROR", JOptionPane.ERROR_MESSAGE);
		}
		else
		{
			performance.setObject(data);
			performance.setOp_code(OP_CODE.PERFORMANCE_STAGE);
			ScreenManager.getClient().accept(performance);
			JOptionPane.showMessageDialog(null, "Your stage was updated successfully !!", "", JOptionPane.INFORMATION_MESSAGE);
		}
	}
}
		
			
		
		
		
	
